package com.wct.spzx.utils;

import com.wct.spzx.model.entity.system.SysUser;

/**
 * @author chang
 * @date 2023/12/11/011 19:53
 */
public class AuthContextUtil {
    // 创建ThreadLocal对象
    public static final ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    /** 添加数据
     * @param sysUser
     */
    public static void set(SysUser sysUser) {
        threadLocal.set(sysUser);
    }

    /** 获取数据
     *
     * @return
     */
    public static SysUser get() {
        return threadLocal.get();
    }

    /** 删除数据
     *
     */
    public static void remove() {
        threadLocal.remove();
    }
}
